<template>
	<view>
		<view style="width: 100vw; height: 100vh;" class="padding-sm text-center flex flex-direction justify-center align-center">
			<!-- <image 
				mode="aspectFit"
				src="https://yl-1346967611.cos.ap-beijing.myqcloud.com/location/d07695067367c2a8824b7545a5416edc.gif"></image> -->
				
			<image
				mode="aspectFit"
				src="https://wimg.588ku.com/gif620/21/06/28/8dd950e83a68e226ad8262f9a0304561.gif"></image>
		</view>
	</view>
</template>

<script>
	const citySelector = requirePlugin('citySelector');
	
	export default {
		data: function() {
			return {
				locamap: undefined,
				flg: 0
			};
		},
		computed: {
			top: function() {
				return this.CustomBar;
			},
		},
		methods: {
			changeCity: function() {
				this.flg = 1;
				this.location.toCitySelector();
			},
			
		},
		onLoad: function(param) {
			this.locamap = this.location.localmap;
			setTimeout(() => {
				this.changeCity();
			}, 200);
			
		},
		onShow: function(param) {
			if (this.flg == 1) {
				const selectedCity = citySelector.getCity();
				if (null != selectedCity) {
					const currentObj = this.locamap.cmap[selectedCity.id];
					let curLocation = {};
					if (currentObj) {
						if (currentObj.scode === "000000") {
							curLocation.proviceid = currentObj.cricode;
							curLocation.provice = this.locamap.cmap[curLocation.proviceid];
						} else {
							curLocation.cityid = currentObj.cricode;
							curLocation.city = this.locamap.cmap[curLocation.cityid];
				
							curLocation.proviceid = curLocation.city.scode;
							curLocation.provice = this.locamap.cmap[curLocation.proviceid];
						}
				
						this.store.commit("setLocation", curLocation);
						uni.navigateBack();
					} else {
						console.log("找不到定位的城市");
					}
				} else {
					console.log("没有打开定位城市");
				}
			}
			

		},
	}
</script>

<style>
</style>